<template>
    <popup width="700" title="器械商详情" @onclose="close">
      <div class="detail-wrapper">
        <div class="detail-item">
          <div class="detail-label">头像</div>
          <div class="detail-value">
            <img :src="detailData.avatar" class="avatar" />
          </div>
        </div>
        <div class="detail-item">
          <div class="detail-label">名称</div>
          <div class="detail-value">{{ detailData.name }}</div>
        </div>
        <div class="detail-item">
          <div class="detail-label">经营地址</div>
          <div class="detail-value">{{ detailData.address }}</div>
        </div>
        <!-- 其他字段展示 -->
      </div>
    </popup>
  </template>
  
  <script setup>
  import { ref } from "vue";
  import { getMedicalUserDetailAPI } from "@/network/medicaluser";
  
  const detailData = ref({});
  const popupRef = ref(null);
  
  const open = async (id) => {
    const res = await getMedicalUserDetailAPI(id);
    detailData.value = res;
    popupRef.value?.open();
  };
  
  const close = () => popupRef.value?.close();
  
  defineExpose({ open });
  </script>
  
  <style scoped>
  .avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
  }
  </style>